<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Insns (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Insns (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Insns (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="RTL.html" rel="up" title="RTL">
<link href="Calls.html" rel="next" title="Calls">
<link href="Debug-Information.html" rel="prev" title="Debug Information">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="section-level-extent" id="Insns">
<div class="nav-panel">
<p>
Next: <a href="Calls.html" accesskey="n" rel="next">RTL Representation of Function-Call Insns</a>, Previous: <a href="Debug-Information.html" accesskey="p" rel="prev">Variable Location Debug Information in RTL</a>, Up: <a href="RTL.html" accesskey="u" rel="up">RTL Representation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Insns-1"><span>14.19 Insns<a class="copiable-link" href="#Insns-1"> &para;</a></span></h3>
<a class="index-entry-id" id="index-insns"></a>

<p>The RTL representation of the code for a function is a doubly-linked
chain of objects called <em class="dfn">insns</em>.  Insns are expressions with
special codes that are used for no other purpose.  Some insns are
actual instructions; others represent dispatch tables for <code class="code">switch</code>
statements; others represent labels to jump to or various sorts of
declarative information.
</p>
<p>In addition to its own specific data, each insn must have a unique
id-number that distinguishes it from all other insns in the current
function (after delayed branch scheduling, copies of an insn with the
same id-number may be present in multiple places in a function, but
these copies will always be identical and will only appear inside a
<code class="code">sequence</code>), and chain pointers to the preceding and following
insns.  These three fields occupy the same position in every insn,
independent of the expression code of the insn.  They could be accessed
with <code class="code">XEXP</code> and <code class="code">XINT</code>, but instead three special macros are
always used:
</p>
<dl class="table">
<dt><a id="index-INSN_005fUID"></a><span><code class="code">INSN_UID (<var class="var">i</var>)</code><a class="copiable-link" href="#index-INSN_005fUID"> &para;</a></span></dt>
<dd><p>Accesses the unique id of insn <var class="var">i</var>.
</p>
</dd>
<dt><a id="index-PREV_005fINSN"></a><span><code class="code">PREV_INSN (<var class="var">i</var>)</code><a class="copiable-link" href="#index-PREV_005fINSN"> &para;</a></span></dt>
<dd><p>Accesses the chain pointer to the insn preceding <var class="var">i</var>.
If <var class="var">i</var> is the first insn, this is a null pointer.
</p>
</dd>
<dt><a id="index-NEXT_005fINSN"></a><span><code class="code">NEXT_INSN (<var class="var">i</var>)</code><a class="copiable-link" href="#index-NEXT_005fINSN"> &para;</a></span></dt>
<dd><p>Accesses the chain pointer to the insn following <var class="var">i</var>.
If <var class="var">i</var> is the last insn, this is a null pointer.
</p></dd>
</dl>

<a class="index-entry-id" id="index-get_005finsns"></a>
<a class="index-entry-id" id="index-get_005flast_005finsn"></a>
<p>The first insn in the chain is obtained by calling <code class="code">get_insns</code>; the
last insn is the result of calling <code class="code">get_last_insn</code>.  Within the
chain delimited by these insns, the <code class="code">NEXT_INSN</code> and
<code class="code">PREV_INSN</code> pointers must always correspond: if <var class="var">insn</var> is not
the first insn,
</p>
<div class="example smallexample">
<pre class="example-preformatted">NEXT_INSN (PREV_INSN (<var class="var">insn</var>)) == <var class="var">insn</var>
</pre></div>

<p>is always true and if <var class="var">insn</var> is not the last insn,
</p>
<div class="example smallexample">
<pre class="example-preformatted">PREV_INSN (NEXT_INSN (<var class="var">insn</var>)) == <var class="var">insn</var>
</pre></div>

<p>is always true.
</p>
<p>After delay slot scheduling, some of the insns in the chain might be
<code class="code">sequence</code> expressions, which contain a vector of insns.  The value
of <code class="code">NEXT_INSN</code> in all but the last of these insns is the next insn
in the vector; the value of <code class="code">NEXT_INSN</code> of the last insn in the vector
is the same as the value of <code class="code">NEXT_INSN</code> for the <code class="code">sequence</code> in
which it is contained.  Similar rules apply for <code class="code">PREV_INSN</code>.
</p>
<p>This means that the above invariants are not necessarily true for insns
inside <code class="code">sequence</code> expressions.  Specifically, if <var class="var">insn</var> is the
first insn in a <code class="code">sequence</code>, <code class="code">NEXT_INSN (PREV_INSN (<var class="var">insn</var>))</code>
is the insn containing the <code class="code">sequence</code> expression, as is the value
of <code class="code">PREV_INSN (NEXT_INSN (<var class="var">insn</var>))</code> if <var class="var">insn</var> is the last
insn in the <code class="code">sequence</code> expression.  You can use these expressions
to find the containing <code class="code">sequence</code> expression.
</p>
<p>Every insn has one of the following expression codes:
</p>
<dl class="table">
<dt><a id="index-insn"></a><span><code class="code">insn</code><a class="copiable-link" href="#index-insn"> &para;</a></span></dt>
<dd><p>The expression code <code class="code">insn</code> is used for instructions that do not jump
and do not do function calls.  <code class="code">sequence</code> expressions are always
contained in insns with code <code class="code">insn</code> even if one of those insns
should jump or do function calls.
</p>
<p>Insns with code <code class="code">insn</code> have four additional fields beyond the three
mandatory ones listed above.  These four are described in a table below.
</p>
</dd>
<dt><a id="index-jump_005finsn"></a><span><code class="code">jump_insn</code><a class="copiable-link" href="#index-jump_005finsn"> &para;</a></span></dt>
<dd><p>The expression code <code class="code">jump_insn</code> is used for instructions that may
jump (or, more generally, may contain <code class="code">label_ref</code> expressions to
which <code class="code">pc</code> can be set in that instruction).  If there is an
instruction to return from the current function, it is recorded as a
<code class="code">jump_insn</code>.
</p>
<a class="index-entry-id" id="index-JUMP_005fLABEL"></a>
<p><code class="code">jump_insn</code> insns have the same extra fields as <code class="code">insn</code> insns,
accessed in the same way and in addition contain a field
<code class="code">JUMP_LABEL</code> which is defined once jump optimization has completed.
</p>
<p>For simple conditional and unconditional jumps, this field contains
the <code class="code">code_label</code> to which this insn will (possibly conditionally)
branch.  In a more complex jump, <code class="code">JUMP_LABEL</code> records one of the
labels that the insn refers to; other jump target labels are recorded
as <code class="code">REG_LABEL_TARGET</code> notes.  The exception is <code class="code">addr_vec</code>
and <code class="code">addr_diff_vec</code>, where <code class="code">JUMP_LABEL</code> is <code class="code">NULL_RTX</code>
and the only way to find the labels is to scan the entire body of the
insn.
</p>
<p>Return insns count as jumps, but their <code class="code">JUMP_LABEL</code> is <code class="code">RETURN</code>
or <code class="code">SIMPLE_RETURN</code>.
</p>
</dd>
<dt><a id="index-call_005finsn"></a><span><code class="code">call_insn</code><a class="copiable-link" href="#index-call_005finsn"> &para;</a></span></dt>
<dd><p>The expression code <code class="code">call_insn</code> is used for instructions that may do
function calls.  It is important to distinguish these instructions because
they imply that certain registers and memory locations may be altered
unpredictably.
</p>
<a class="index-entry-id" id="index-CALL_005fINSN_005fFUNCTION_005fUSAGE"></a>
<p><code class="code">call_insn</code> insns have the same extra fields as <code class="code">insn</code> insns,
accessed in the same way and in addition contain a field
<code class="code">CALL_INSN_FUNCTION_USAGE</code>, which contains a list (chain of
<code class="code">expr_list</code> expressions) containing <code class="code">use</code>, <code class="code">clobber</code> and
sometimes <code class="code">set</code> expressions that denote hard registers and
<code class="code">mem</code>s used or clobbered by the called function.
</p>
<p>A <code class="code">mem</code> generally points to a stack slot in which arguments passed
to the libcall by reference (see <a class="pxref" href="Register-Arguments.html">TARGET_PASS_BY_REFERENCE</a>) are stored.  If the argument is
caller-copied (see <a class="pxref" href="Register-Arguments.html">TARGET_CALLEE_COPIES</a>),
the stack slot will be mentioned in <code class="code">clobber</code> and <code class="code">use</code>
entries; if it&rsquo;s callee-copied, only a <code class="code">use</code> will appear, and the
<code class="code">mem</code> may point to addresses that are not stack slots.
</p>
<p>Registers occurring inside a <code class="code">clobber</code> in this list augment
registers specified in <code class="code">CALL_USED_REGISTERS</code> (see <a class="pxref" href="Register-Basics.html">Basic Characteristics of Registers</a>).
</p>
<p>If the list contains a <code class="code">set</code> involving two registers, it indicates
that the function returns one of its arguments.  Such a <code class="code">set</code> may
look like a no-op if the same register holds the argument and the return
value.
</p>
</dd>
<dt><a class="index-entry-id" id="index-CODE_005fLABEL_005fNUMBER"></a>
<a id="index-code_005flabel"></a><span><code class="code">code_label</code><a class="copiable-link" href="#index-code_005flabel"> &para;</a></span></dt>
<dd><p>A <code class="code">code_label</code> insn represents a label that a jump insn can jump
to.  It contains two special fields of data in addition to the three
standard ones.  <code class="code">CODE_LABEL_NUMBER</code> is used to hold the <em class="dfn">label
number</em>, a number that identifies this label uniquely among all the
labels in the compilation (not just in the current function).
Ultimately, the label is represented in the assembler output as an
assembler label, usually of the form &lsquo;<samp class="samp">L<var class="var">n</var></samp>&rsquo; where <var class="var">n</var> is
the label number.
</p>
<p>When a <code class="code">code_label</code> appears in an RTL expression, it normally
appears within a <code class="code">label_ref</code> which represents the address of
the label, as a number.
</p>
<p>Besides as a <code class="code">code_label</code>, a label can also be represented as a
<code class="code">note</code> of type <code class="code">NOTE_INSN_DELETED_LABEL</code>.
</p>
<a class="index-entry-id" id="index-LABEL_005fNUSES"></a>
<p>The field <code class="code">LABEL_NUSES</code> is only defined once the jump optimization
phase is completed.  It contains the number of times this label is
referenced in the current function.
</p>
<a class="index-entry-id" id="index-LABEL_005fKIND"></a>
<a class="index-entry-id" id="index-SET_005fLABEL_005fKIND"></a>
<a class="index-entry-id" id="index-LABEL_005fALT_005fENTRY_005fP"></a>
<a class="index-entry-id" id="index-alternate-entry-points"></a>
<p>The field <code class="code">LABEL_KIND</code> differentiates four different types of
labels: <code class="code">LABEL_NORMAL</code>, <code class="code">LABEL_STATIC_ENTRY</code>,
<code class="code">LABEL_GLOBAL_ENTRY</code>, and <code class="code">LABEL_WEAK_ENTRY</code>.  The only labels
that do not have type <code class="code">LABEL_NORMAL</code> are <em class="dfn">alternate entry
points</em> to the current function.  These may be static (visible only in
the containing translation unit), global (exposed to all translation
units), or weak (global, but can be overridden by another symbol with the
same name).
</p>
<p>Much of the compiler treats all four kinds of label identically.  Some
of it needs to know whether or not a label is an alternate entry point;
for this purpose, the macro <code class="code">LABEL_ALT_ENTRY_P</code> is provided.  It is
equivalent to testing whether &lsquo;<samp class="samp">LABEL_KIND (label) == LABEL_NORMAL</samp>&rsquo;.
The only place that cares about the distinction between static, global,
and weak alternate entry points, besides the front-end code that creates
them, is the function <code class="code">output_alternate_entry_point</code>, in
<samp class="file">final.cc</samp>.
</p>
<p>To set the kind of a label, use the <code class="code">SET_LABEL_KIND</code> macro.
</p>
</dd>
<dt><a id="index-jump_005ftable_005fdata"></a><span><code class="code">jump_table_data</code><a class="copiable-link" href="#index-jump_005ftable_005fdata"> &para;</a></span></dt>
<dd><p>A <code class="code">jump_table_data</code> insn is a placeholder for the jump-table data
of a <code class="code">casesi</code> or <code class="code">tablejump</code> insn.  They are placed after
a <code class="code">tablejump_p</code> insn.  A <code class="code">jump_table_data</code> insn is not part o
a basic blockm but it is associated with the basic block that ends with
the <code class="code">tablejump_p</code> insn.  The <code class="code">PATTERN</code> of a <code class="code">jump_table_data</code>
is always either an <code class="code">addr_vec</code> or an <code class="code">addr_diff_vec</code>, and a
<code class="code">jump_table_data</code> insn is always preceded by a <code class="code">code_label</code>.
The <code class="code">tablejump_p</code> insn refers to that <code class="code">code_label</code> via its
<code class="code">JUMP_LABEL</code>.
</p>
</dd>
<dt><a id="index-barrier"></a><span><code class="code">barrier</code><a class="copiable-link" href="#index-barrier"> &para;</a></span></dt>
<dd><p>Barriers are placed in the instruction stream when control cannot flow
past them.  They are placed after unconditional jump instructions to
indicate that the jumps are unconditional and after calls to
<code class="code">volatile</code> functions, which do not return (e.g., <code class="code">exit</code>).
They contain no information beyond the three standard fields.
</p>
</dd>
<dt><a class="index-entry-id" id="index-NOTE_005fLINE_005fNUMBER"></a>
<a class="index-entry-id" id="index-NOTE_005fSOURCE_005fFILE"></a>
<a id="index-note"></a><span><code class="code">note</code><a class="copiable-link" href="#index-note"> &para;</a></span></dt>
<dd><p><code class="code">note</code> insns are used to represent additional debugging and
declarative information.  They contain two nonstandard fields, an
integer which is accessed with the macro <code class="code">NOTE_LINE_NUMBER</code> and a
string accessed with <code class="code">NOTE_SOURCE_FILE</code>.
</p>
<p>If <code class="code">NOTE_LINE_NUMBER</code> is positive, the note represents the
position of a source line and <code class="code">NOTE_SOURCE_FILE</code> is the source file name
that the line came from.  These notes control generation of line
number data in the assembler output.
</p>
<p>Otherwise, <code class="code">NOTE_LINE_NUMBER</code> is not really a line number but a
code with one of the following values (and <code class="code">NOTE_SOURCE_FILE</code>
must contain a null pointer):
</p>
<dl class="table">
<dt><a id="index-NOTE_005fINSN_005fDELETED"></a><span><code class="code">NOTE_INSN_DELETED</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fDELETED"> &para;</a></span></dt>
<dd><p>Such a note is completely ignorable.  Some passes of the compiler
delete insns by altering them into notes of this kind.
</p>
</dd>
<dt><a id="index-NOTE_005fINSN_005fDELETED_005fLABEL"></a><span><code class="code">NOTE_INSN_DELETED_LABEL</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fDELETED_005fLABEL"> &para;</a></span></dt>
<dd><p>This marks what used to be a <code class="code">code_label</code>, but was not used for other
purposes than taking its address and was transformed to mark that no
code jumps to it.
</p>
</dd>
<dt><a class="index-entry-id" id="index-NOTE_005fINSN_005fBLOCK_005fEND"></a>
<a id="index-NOTE_005fINSN_005fBLOCK_005fBEG"></a><span><code class="code">NOTE_INSN_BLOCK_BEG</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fBLOCK_005fBEG"> &para;</a></span></dt>
<dt><code class="code">NOTE_INSN_BLOCK_END</code></dt>
<dd><p>These types of notes indicate the position of the beginning and end
of a level of scoping of variable names.  They control the output
of debugging information.
</p>
</dd>
<dt><a class="index-entry-id" id="index-NOTE_005fINSN_005fEH_005fREGION_005fEND"></a>
<a id="index-NOTE_005fINSN_005fEH_005fREGION_005fBEG"></a><span><code class="code">NOTE_INSN_EH_REGION_BEG</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fEH_005fREGION_005fBEG"> &para;</a></span></dt>
<dt><code class="code">NOTE_INSN_EH_REGION_END</code></dt>
<dd><p>These types of notes indicate the position of the beginning and end of a
level of scoping for exception handling.  <code class="code">NOTE_EH_HANDLER</code>
identifies which region is associated with these notes.
</p>
</dd>
<dt><a id="index-NOTE_005fINSN_005fFUNCTION_005fBEG"></a><span><code class="code">NOTE_INSN_FUNCTION_BEG</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fFUNCTION_005fBEG"> &para;</a></span></dt>
<dd><p>Appears at the start of the function body, after the function
prologue.
</p>
</dd>
<dt><a class="index-entry-id" id="index-NOTE_005fVAR_005fLOCATION"></a>
<a id="index-NOTE_005fINSN_005fVAR_005fLOCATION"></a><span><code class="code">NOTE_INSN_VAR_LOCATION</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fVAR_005fLOCATION"> &para;</a></span></dt>
<dd><p>This note is used to generate variable location debugging information.
It indicates that the user variable in its <code class="code">VAR_LOCATION</code> operand
is at the location given in the RTL expression, or holds a value that
can be computed by evaluating the RTL expression from that static
point in the program up to the next such note for the same user
variable.
</p>
</dd>
<dt><a id="index-NOTE_005fINSN_005fBEGIN_005fSTMT"></a><span><code class="code">NOTE_INSN_BEGIN_STMT</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fBEGIN_005fSTMT"> &para;</a></span></dt>
<dd><p>This note is used to generate <code class="code">is_stmt</code> markers in line number
debugging information.  It indicates the beginning of a user
statement.
</p>
</dd>
<dt><a id="index-NOTE_005fINSN_005fINLINE_005fENTRY"></a><span><code class="code">NOTE_INSN_INLINE_ENTRY</code><a class="copiable-link" href="#index-NOTE_005fINSN_005fINLINE_005fENTRY"> &para;</a></span></dt>
<dd><p>This note is used to generate <code class="code">entry_pc</code> for inlined subroutines in
debugging information.  It indicates an inspection point at which all
arguments for the inlined function have been bound, and before its first
statement.
</p>
</dd>
</dl>

<p>These codes are printed symbolically when they appear in debugging dumps.
</p>
</dd>
<dt><a class="index-entry-id" id="index-INSN_005fVAR_005fLOCATION"></a>
<a id="index-debug_005finsn"></a><span><code class="code">debug_insn</code><a class="copiable-link" href="#index-debug_005finsn"> &para;</a></span></dt>
<dd><p>The expression code <code class="code">debug_insn</code> is used for pseudo-instructions
that hold debugging information for variable tracking at assignments
(see <samp class="option">-fvar-tracking-assignments</samp> option).  They are the RTL
representation of <code class="code">GIMPLE_DEBUG</code> statements
(<a class="ref" href="GIMPLE_005fDEBUG.html"><code class="code">GIMPLE_DEBUG</code></a>), with a <code class="code">VAR_LOCATION</code> operand that
binds a user variable tree to an RTL representation of the
<code class="code">value</code> in the corresponding statement.  A <code class="code">DEBUG_EXPR</code> in
it stands for the value bound to the corresponding
<code class="code">DEBUG_EXPR_DECL</code>.
</p>
<p><code class="code">GIMPLE_DEBUG_BEGIN_STMT</code> and <code class="code">GIMPLE_DEBUG_INLINE_ENTRY</code> are
expanded to RTL as a <code class="code">DEBUG_INSN</code> with a <code class="code">DEBUG_MARKER</code>
<code class="code">PATTERN</code>; the difference is the RTL mode: the former&rsquo;s
<code class="code">DEBUG_MARKER</code> is <code class="code">VOIDmode</code>, whereas the latter is
<code class="code">BLKmode</code>; information about the inlined function can be taken from
the lexical block encoded in the <code class="code">INSN_LOCATION</code>.  These
<code class="code">DEBUG_INSN</code>s, that do not carry <code class="code">VAR_LOCATION</code> information,
just <code class="code">DEBUG_MARKER</code>s, can be detected by testing
<code class="code">DEBUG_MARKER_INSN_P</code>, whereas those that do can be recognized as
<code class="code">DEBUG_BIND_INSN_P</code>.
</p>
<p>Throughout optimization passes, <code class="code">DEBUG_INSN</code>s are not reordered
with respect to each other, particularly during scheduling.  Binding
information is kept in pseudo-instruction form, so that, unlike notes,
it gets the same treatment and adjustments that regular instructions
would.  It is the variable tracking pass that turns these
pseudo-instructions into <code class="code">NOTE_INSN_VAR_LOCATION</code>,
<code class="code">NOTE_INSN_BEGIN_STMT</code> and <code class="code">NOTE_INSN_INLINE_ENTRY</code> notes,
analyzing control flow, value equivalences and changes to registers and
memory referenced in value expressions, propagating the values of debug
temporaries and determining expressions that can be used to compute the
value of each user variable at as many points (ranges, actually) in the
program as possible.
</p>
<p>Unlike <code class="code">NOTE_INSN_VAR_LOCATION</code>, the value expression in an
<code class="code">INSN_VAR_LOCATION</code> denotes a value at that specific point in the
program, rather than an expression that can be evaluated at any later
point before an overriding <code class="code">VAR_LOCATION</code> is encountered.  E.g.,
if a user variable is bound to a <code class="code">REG</code> and then a subsequent insn
modifies the <code class="code">REG</code>, the note location would keep mapping the user
variable to the register across the insn, whereas the insn location
would keep the variable bound to the value, so that the variable
tracking pass would emit another location note for the variable at the
point in which the register is modified.
</p>
</dd>
</dl>

<a class="index-entry-id" id="index-TImode_002c-in-insn"></a>
<a class="index-entry-id" id="index-HImode_002c-in-insn"></a>
<a class="index-entry-id" id="index-QImode_002c-in-insn"></a>
<p>The machine mode of an insn is normally <code class="code">VOIDmode</code>, but some
phases use the mode for various purposes.
</p>
<p>The common subexpression elimination pass sets the mode of an insn to
<code class="code">QImode</code> when it is the first insn in a block that has already
been processed.
</p>
<p>The second Haifa scheduling pass, for targets that can multiple issue,
sets the mode of an insn to <code class="code">TImode</code> when it is believed that the
instruction begins an issue group.  That is, when the instruction
cannot issue simultaneously with the previous.  This may be relied on
by later passes, in particular machine-dependent reorg.
</p>
<p>Here is a table of the extra fields of <code class="code">insn</code>, <code class="code">jump_insn</code>
and <code class="code">call_insn</code> insns:
</p>
<dl class="table">
<dt><a id="index-PATTERN"></a><span><code class="code">PATTERN (<var class="var">i</var>)</code><a class="copiable-link" href="#index-PATTERN"> &para;</a></span></dt>
<dd><p>An expression for the side effect performed by this insn.  This must
be one of the following codes: <code class="code">set</code>, <code class="code">call</code>, <code class="code">use</code>,
<code class="code">clobber</code>, <code class="code">return</code>, <code class="code">simple_return</code>, <code class="code">asm_input</code>,
<code class="code">asm_output</code>, <code class="code">addr_vec</code>, <code class="code">addr_diff_vec</code>,
<code class="code">trap_if</code>, <code class="code">unspec</code>, <code class="code">unspec_volatile</code>,
<code class="code">parallel</code>, <code class="code">cond_exec</code>, or <code class="code">sequence</code>.  If it is a
<code class="code">parallel</code>, each element of the <code class="code">parallel</code> must be one these
codes, except that <code class="code">parallel</code> expressions cannot be nested and
<code class="code">addr_vec</code> and <code class="code">addr_diff_vec</code> are not permitted inside a
<code class="code">parallel</code> expression.
</p>
</dd>
<dt><a id="index-INSN_005fCODE"></a><span><code class="code">INSN_CODE (<var class="var">i</var>)</code><a class="copiable-link" href="#index-INSN_005fCODE"> &para;</a></span></dt>
<dd><p>An integer that says which pattern in the machine description matches
this insn, or &minus;1 if the matching has not yet been attempted.
</p>
<p>Such matching is never attempted and this field remains &minus;1 on an insn
whose pattern consists of a single <code class="code">use</code>, <code class="code">clobber</code>,
<code class="code">asm_input</code>, <code class="code">addr_vec</code> or <code class="code">addr_diff_vec</code> expression.
</p>
<a class="index-entry-id" id="index-asm_005fnoperands"></a>
<p>Matching is also never attempted on insns that result from an <code class="code">asm</code>
statement.  These contain at least one <code class="code">asm_operands</code> expression.
The function <code class="code">asm_noperands</code> returns a non-negative value for
such insns.
</p>
<p>In the debugging output, this field is printed as a number followed by
a symbolic representation that locates the pattern in the <samp class="file">md</samp>
file as some small positive or negative offset from a named pattern.
</p>
</dd>
<dt><a id="index-REG_005fNOTES"></a><span><code class="code">REG_NOTES (<var class="var">i</var>)</code><a class="copiable-link" href="#index-REG_005fNOTES"> &para;</a></span></dt>
<dd><p>A list (chain of <code class="code">expr_list</code>, <code class="code">insn_list</code> and <code class="code">int_list</code>
expressions) giving miscellaneous information about the insn.  It is often
information pertaining to the registers used in this insn.
</p></dd>
</dl>

<p>The <code class="code">REG_NOTES</code> field of an insn is a chain that includes
<code class="code">expr_list</code> and <code class="code">int_list</code> expressions as well as <code class="code">insn_list</code>
expressions.  There are several
kinds of register notes, which are distinguished by the machine mode, which
in a register note is really understood as being an <code class="code">enum reg_note</code>.
The first operand <var class="var">op</var> of the note is data whose meaning depends on
the kind of note.
</p>
<a class="index-entry-id" id="index-REG_005fNOTE_005fKIND"></a>
<a class="index-entry-id" id="index-PUT_005fREG_005fNOTE_005fKIND"></a>
<p>The macro <code class="code">REG_NOTE_KIND (<var class="var">x</var>)</code> returns the kind of
register note.  Its counterpart, the macro <code class="code">PUT_REG_NOTE_KIND
(<var class="var">x</var>, <var class="var">newkind</var>)</code> sets the register note type of <var class="var">x</var> to be
<var class="var">newkind</var>.
</p>
<p>Register notes are of three classes: They may say something about an
input to an insn, they may say something about an output of an insn, or
they may create a linkage between two insns.
</p>
<p>These register notes annotate inputs to an insn:
</p>
<dl class="table">
<dt><a id="index-REG_005fDEAD"></a><span><code class="code">REG_DEAD</code><a class="copiable-link" href="#index-REG_005fDEAD"> &para;</a></span></dt>
<dd><p>The value in <var class="var">op</var> dies in this insn; that is to say, altering the
value immediately after this insn would not affect the future behavior
of the program.
</p>
<p>It does not follow that the register <var class="var">op</var> has no useful value after
this insn since <var class="var">op</var> is not necessarily modified by this insn.
Rather, no subsequent instruction uses the contents of <var class="var">op</var>.
</p>
</dd>
<dt><a id="index-REG_005fUNUSED"></a><span><code class="code">REG_UNUSED</code><a class="copiable-link" href="#index-REG_005fUNUSED"> &para;</a></span></dt>
<dd><p>The register <var class="var">op</var> being set by this insn will not be used in a
subsequent insn.  This differs from a <code class="code">REG_DEAD</code> note, which
indicates that the value in an input will not be used subsequently.
These two notes are independent; both may be present for the same
register.
</p>
</dd>
<dt><a id="index-REG_005fINC"></a><span><code class="code">REG_INC</code><a class="copiable-link" href="#index-REG_005fINC"> &para;</a></span></dt>
<dd><p>The register <var class="var">op</var> is incremented (or decremented; at this level
there is no distinction) by an embedded side effect inside this insn.
This means it appears in a <code class="code">post_inc</code>, <code class="code">pre_inc</code>,
<code class="code">post_dec</code> or <code class="code">pre_dec</code> expression.
</p>
</dd>
<dt><a id="index-REG_005fNONNEG"></a><span><code class="code">REG_NONNEG</code><a class="copiable-link" href="#index-REG_005fNONNEG"> &para;</a></span></dt>
<dd><p>The register <var class="var">op</var> is known to have a nonnegative value when this
insn is reached.  This is used by special looping instructions
that terminate when the register goes negative.
</p>
<p>The <code class="code">REG_NONNEG</code> note is added only to &lsquo;<samp class="samp">doloop_end</samp>&rsquo;
insns, if its pattern uses a <code class="code">ge</code> condition.
</p>
</dd>
<dt><a id="index-REG_005fLABEL_005fOPERAND"></a><span><code class="code">REG_LABEL_OPERAND</code><a class="copiable-link" href="#index-REG_005fLABEL_005fOPERAND"> &para;</a></span></dt>
<dd><p>This insn uses <var class="var">op</var>, a <code class="code">code_label</code> or a <code class="code">note</code> of type
<code class="code">NOTE_INSN_DELETED_LABEL</code>, but is not a <code class="code">jump_insn</code>, or it
is a <code class="code">jump_insn</code> that refers to the operand as an ordinary
operand.  The label may still eventually be a jump target, but if so
in an indirect jump in a subsequent insn.  The presence of this note
allows jump optimization to be aware that <var class="var">op</var> is, in fact, being
used, and flow optimization to build an accurate flow graph.
</p>
</dd>
<dt><a id="index-REG_005fLABEL_005fTARGET"></a><span><code class="code">REG_LABEL_TARGET</code><a class="copiable-link" href="#index-REG_005fLABEL_005fTARGET"> &para;</a></span></dt>
<dd><p>This insn is a <code class="code">jump_insn</code> but not an <code class="code">addr_vec</code> or
<code class="code">addr_diff_vec</code>.  It uses <var class="var">op</var>, a <code class="code">code_label</code> as a
direct or indirect jump target.  Its purpose is similar to that of
<code class="code">REG_LABEL_OPERAND</code>.  This note is only present if the insn has
multiple targets; the last label in the insn (in the highest numbered
insn-field) goes into the <code class="code">JUMP_LABEL</code> field and does not have a
<code class="code">REG_LABEL_TARGET</code> note.  See <a class="xref" href="#Insns">JUMP_LABEL</a>.
</p>
</dd>
<dt><a id="index-REG_005fSETJMP"></a><span><code class="code">REG_SETJMP</code><a class="copiable-link" href="#index-REG_005fSETJMP"> &para;</a></span></dt>
<dd><p>Appears attached to each <code class="code">CALL_INSN</code> to <code class="code">setjmp</code> or a
related function.
</p></dd>
</dl>

<p>The following notes describe attributes of outputs of an insn:
</p>
<dl class="table">
<dt><a class="index-entry-id" id="index-REG_005fEQUAL"></a>
<a id="index-REG_005fEQUIV"></a><span><code class="code">REG_EQUIV</code><a class="copiable-link" href="#index-REG_005fEQUIV"> &para;</a></span></dt>
<dt><code class="code">REG_EQUAL</code></dt>
<dd><p>This note is only valid on an insn that sets only one register and
indicates that that register will be equal to <var class="var">op</var> at run time; the
scope of this equivalence differs between the two types of notes.  The
value which the insn explicitly copies into the register may look
different from <var class="var">op</var>, but they will be equal at run time.  If the
output of the single <code class="code">set</code> is a <code class="code">strict_low_part</code> or
<code class="code">zero_extract</code> expression, the note refers to the register that
is contained in its first operand.
</p>
<p>For <code class="code">REG_EQUIV</code>, the register is equivalent to <var class="var">op</var> throughout
the entire function, and could validly be replaced in all its
occurrences by <var class="var">op</var>.  (&ldquo;Validly&rdquo; here refers to the data flow of
the program; simple replacement may make some insns invalid.)  For
example, when a constant is loaded into a register that is never
assigned any other value, this kind of note is used.
</p>
<p>When a parameter is copied into a pseudo-register at entry to a function,
a note of this kind records that the register is equivalent to the stack
slot where the parameter was passed.  Although in this case the register
may be set by other insns, it is still valid to replace the register
by the stack slot throughout the function.
</p>
<p>A <code class="code">REG_EQUIV</code> note is also used on an instruction which copies a
register parameter into a pseudo-register at entry to a function, if
there is a stack slot where that parameter could be stored.  Although
other insns may set the pseudo-register, it is valid for the compiler to
replace the pseudo-register by stack slot throughout the function,
provided the compiler ensures that the stack slot is properly
initialized by making the replacement in the initial copy instruction as
well.  This is used on machines for which the calling convention
allocates stack space for register parameters.  See
<code class="code">REG_PARM_STACK_SPACE</code> in <a class="ref" href="Stack-Arguments.html">Passing Function Arguments on the Stack</a>.
</p>
<p>In the case of <code class="code">REG_EQUAL</code>, the register that is set by this insn
will be equal to <var class="var">op</var> at run time at the end of this insn but not
necessarily elsewhere in the function.  In this case, <var class="var">op</var>
is typically an arithmetic expression.  For example, when a sequence of
insns such as a library call is used to perform an arithmetic operation,
this kind of note is attached to the insn that produces or copies the
final value.
</p>
<p>These two notes are used in different ways by the compiler passes.
<code class="code">REG_EQUAL</code> is used by passes prior to register allocation (such as
common subexpression elimination and loop optimization) to tell them how
to think of that value.  <code class="code">REG_EQUIV</code> notes are used by register
allocation to indicate that there is an available substitute expression
(either a constant or a <code class="code">mem</code> expression for the location of a
parameter on the stack) that may be used in place of a register if
insufficient registers are available.
</p>
<p>Except for stack homes for parameters, which are indicated by a
<code class="code">REG_EQUIV</code> note and are not useful to the early optimization
passes and pseudo registers that are equivalent to a memory location
throughout their entire life, which is not detected until later in
the compilation, all equivalences are initially indicated by an attached
<code class="code">REG_EQUAL</code> note.  In the early stages of register allocation, a
<code class="code">REG_EQUAL</code> note is changed into a <code class="code">REG_EQUIV</code> note if
<var class="var">op</var> is a constant and the insn represents the only set of its
destination register.
</p>
<p>Thus, compiler passes prior to register allocation need only check for
<code class="code">REG_EQUAL</code> notes and passes subsequent to register allocation
need only check for <code class="code">REG_EQUIV</code> notes.
</p></dd>
</dl>

<p>These notes describe linkages between insns.  They occur in pairs: one
insn has one of a pair of notes that points to a second insn, which has
the inverse note pointing back to the first insn.
</p>
<dl class="table">
<dt><a id="index-REG_005fDEP_005fTRUE"></a><span><code class="code">REG_DEP_TRUE</code><a class="copiable-link" href="#index-REG_005fDEP_005fTRUE"> &para;</a></span></dt>
<dd><p>This indicates a true dependence (a read after write dependence).
</p>
</dd>
<dt><a id="index-REG_005fDEP_005fOUTPUT"></a><span><code class="code">REG_DEP_OUTPUT</code><a class="copiable-link" href="#index-REG_005fDEP_005fOUTPUT"> &para;</a></span></dt>
<dd><p>This indicates an output dependence (a write after write dependence).
</p>
</dd>
<dt><a id="index-REG_005fDEP_005fANTI"></a><span><code class="code">REG_DEP_ANTI</code><a class="copiable-link" href="#index-REG_005fDEP_005fANTI"> &para;</a></span></dt>
<dd><p>This indicates an anti dependence (a write after read dependence).
</p>
</dd>
</dl>

<p>These notes describe information gathered from gcov profile data.  They
are stored in the <code class="code">REG_NOTES</code> field of an insn.
</p>
<dl class="table">
<dt><a id="index-REG_005fBR_005fPROB"></a><span><code class="code">REG_BR_PROB</code><a class="copiable-link" href="#index-REG_005fBR_005fPROB"> &para;</a></span></dt>
<dd><p>This is used to specify the ratio of branches to non-branches of a
branch insn according to the profile data.  The note is represented
as an <code class="code">int_list</code> expression whose integer value is an encoding
of <code class="code">profile_probability</code> type.  <code class="code">profile_probability</code> provide
member function <code class="code">from_reg_br_prob_note</code> and <code class="code">to_reg_br_prob_note</code>
to extract and store the probability into the RTL encoding.
</p>
</dd>
<dt><a id="index-REG_005fBR_005fPRED"></a><span><code class="code">REG_BR_PRED</code><a class="copiable-link" href="#index-REG_005fBR_005fPRED"> &para;</a></span></dt>
<dd><p>These notes are found in JUMP insns after delayed branch scheduling
has taken place.  They indicate both the direction and the likelihood
of the JUMP.  The format is a bitmask of ATTR_FLAG_* values.
</p>
</dd>
<dt><a id="index-REG_005fFRAME_005fRELATED_005fEXPR"></a><span><code class="code">REG_FRAME_RELATED_EXPR</code><a class="copiable-link" href="#index-REG_005fFRAME_005fRELATED_005fEXPR"> &para;</a></span></dt>
<dd><p>This is used on an RTX_FRAME_RELATED_P insn wherein the attached expression
is used in place of the actual insn pattern.  This is done in cases where
the pattern is either complex or misleading.
</p></dd>
</dl>

<p>The note <code class="code">REG_CALL_NOCF_CHECK</code> is used in conjunction with the
<samp class="option">-fcf-protection=branch</samp> option.  The note is set if a
<code class="code">nocf_check</code> attribute is specified for a function type or a
pointer to function type.  The note is stored in the <code class="code">REG_NOTES</code>
field of an insn.
</p>
<dl class="table">
<dt><a id="index-REG_005fCALL_005fNOCF_005fCHECK"></a><span><code class="code">REG_CALL_NOCF_CHECK</code><a class="copiable-link" href="#index-REG_005fCALL_005fNOCF_005fCHECK"> &para;</a></span></dt>
<dd><p>Users have control through the <code class="code">nocf_check</code> attribute to identify
which calls to a function should be skipped from control-flow instrumentation
when the option <samp class="option">-fcf-protection=branch</samp> is specified.  The compiler
puts a <code class="code">REG_CALL_NOCF_CHECK</code> note on each <code class="code">CALL_INSN</code> instruction
that has a function type marked with a <code class="code">nocf_check</code> attribute.
</p></dd>
</dl>

<p>For convenience, the machine mode in an <code class="code">insn_list</code> or
<code class="code">expr_list</code> is printed using these symbolic codes in debugging dumps.
</p>
<a class="index-entry-id" id="index-insn_005flist"></a>
<a class="index-entry-id" id="index-expr_005flist"></a>
<p>The only difference between the expression codes <code class="code">insn_list</code> and
<code class="code">expr_list</code> is that the first operand of an <code class="code">insn_list</code> is
assumed to be an insn and is printed in debugging dumps as the insn&rsquo;s
unique id; the first operand of an <code class="code">expr_list</code> is printed in the
ordinary way as an expression.
</p>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Calls.html">RTL Representation of Function-Call Insns</a>, Previous: <a href="Debug-Information.html">Variable Location Debug Information in RTL</a>, Up: <a href="RTL.html">RTL Representation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
